home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tst.arc / TST.ASM
Assembly Source File  |  1988-04-07  |  7KB  |  261 lines

  1. CSEG    segment para public 'code'
  2.     ORG 100h
  3.     assume cs:cseg
  4.  
  5. SOCKET    EQU    9559h
  6.  
  7. ;********************  THERE IS 1 HARD CODED ADDRESS IN THIS PROGRAM
  8. ;********************  DST1 BELOW NEEDS TO HAVE THE ADDRESS OF THE
  9. ;********************  LISTENING PROGRAM HARD CODED.  THIS IS A 10
  10. ;********************  BYTE NUMBER WITH HIGHEST BYTE FIRST.  A
  11. ;********************  "USERLIST /A" WILL LIST THE ADDRESSES, IE.
  12. ;********************  [     333] [          2A] WOULD BE ENTERED AS:
  13. ;********************  00h,00h,03h,33h,00h,00h,00h,00h,00h,2Ah
  14. ;
  15. ;
  16. ;  Compile into a .COM file, on the machine whose address was entered
  17. ;  below run "TST" without any paramaters.  On another machine run
  18. ;  "TST 1".  The "TST 1" machine will display a character every 10
  19. ;  clock tics, the "TST" machine will echo the packet back to the
  20. ;  calling station which will print the echoed character.  This will
  21. ;  show up as one character printed twice together.
  22. ;
  23. ;  On the 2.1 Omninet drivers this will work so long as the "TST"
  24. ;  machine does not access netware, if accessing netware the machine
  25. ;  will lock up very quickly (Usually less than 1 minute of constant
  26. ;  network access.)
  27.  
  28. ;  The following are the results of testing with different configurations.
  29. ;  TST.COM was loaded on a machine then a batch file which copied a file
  30. ;  and executed its self again was run.  Each test was run about 10 mins.
  31.  
  32. ;  2.1 IPX Omninet no int & 2.1 NET3.COM   20 times locked up within 1 min
  33. ;  2.1 IPX Omninet int 2 & 2.1 NET3.COM    20 times locked up within 1 min
  34. ;  2.1 IPX Arcnet & 2.1 NET3.COM            5 times NO lockup
  35. ;  2.0a ANET3.COM Omninet no int           10 times NO lockup
  36. ;  2.0a ANET3.COM Omninet int 2            10 times NO lockup
  37. ;  2.0a ANET3.COM Pronet 10                 5 times NO lockup
  38. ;  2.1 IPX Omninet no int & 2.0a ANET3.COM 10 time locked up within 1 min
  39. ;  2.1 IPX Omninet int 2 & 2.0a ANET3.COM  10 time locked up within 1 min
  40. ;  2.0a ANET3.COM Arcnet                    5 times NO lockup
  41. ;  2.1 IPX Omni no int no shell DOS copy    5 times NO lockup
  42.  
  43. ;  An INS gateway based on NETBIOS would lock up on 2.1 Omninet after about
  44. ;  10 minutes and always during a read or write.
  45.  
  46. ;  Varying the IPX version on the calling station had no effect on the
  47. ;  outcome of any of the tests.  No other memory resident software was in
  48. ;  use on either the calling or listening computers.  Crossing bridges made
  49. ;  no difference, DOS versions made no difference, the lockup would also
  50. ;  occur doing DIRs or running SYSCON or running LOGIN or TYPEing files, or
  51. ;  any other netware function that I did often enough.  Using a program
  52. ;  called HWLIGHT during some of the copies I did see that the lockups
  53. ;  ALWAYS occured DURING a netware file READ or WRITE.
  54.  
  55. ENTRY:    JMP    MAIN
  56.  
  57. ECB1    dd    0
  58. ADR1    dw    0            ;address of service routine
  59. SEG1    dw    0
  60. INUSE1    db    0            ;in-use flag
  61.     db    0            ;completion code
  62. SOCK1    DW    SOCKET            ;our socket number
  63.     db    16 dup(0)        ;ipx work space
  64. IMAD1    db    6 dup (0)        ;other station's address
  65.     dw    1            ;one fragment
  66.     dw    FRAG1            ;fragment's address
  67. SEG1F    dw    0
  68.     dw    31            ;fragment size
  69.  
  70. FRAG1    db    0,0            ;packet checksum
  71.     db    0,31            ;length
  72.     db    0
  73.     db    0            ;packet type
  74. DST1    db    0,0,0,5,0,0,0,0,0,0Bh        ;DESTINATION **HARD CODE***
  75.     DW    SOCKET
  76. SRC1    db    12 dup(0)        ;his address
  77. MSG1    DB    0            ;message
  78.  
  79. ECB2    dd    0
  80. ADR2    dw    0            ;address of service routine
  81. SEG2    dw    0
  82. INUSE2    db    0            ;in-use flag
  83.     db    0            ;completion code
  84. SOCK2    DW    0            ;our socket number
  85.     db    16 dup(0)        ;ipx work space
  86. IMAD2    db    6 dup (0)        ;other station's address
  87.     dw    1            ;one fragment
  88.     dw    FRAG2            ;fragment's address
  89. SEG2F    dw    0
  90.     dw    31            ;fragment size
  91.  
  92. FRAG2    db    0,0            ;packet checksum
  93.     db    0,31            ;length
  94.     db    0
  95.     db    0            ;packet type
  96. DST2    db    12 dup(0)        ;my address
  97. SRC2    db    12 dup(0)        ;his address
  98. MSG2    DB    0            ;message
  99.  
  100. ECB3    dd    0
  101. ADR3    dw    0            ;address of service routine
  102. SEG3    dw    0
  103. INUSE3    db    0            ;in-use flag
  104.     db    0            ;completion code
  105.     db    36 dup(0)        ;ipx work space
  106.  
  107. ;************************************************************************
  108. ;* Event service routine for memory resident portion of TST             *
  109. ;************************************************************************
  110. RCVD    proc    far            ;event service routine
  111.     push    cs            
  112.     pop    ds
  113.     push    cs
  114.     pop    es
  115.     cld                      ;forward direction
  116.     mov    si,offset IMAD2        ;move immediate addresses
  117.     mov    di,offset IMAD1
  118.     mov    cx,6             ;6 bytes
  119.     rep    movsb
  120.     mov    si,offset SRC2         ;received source address
  121.     mov    di,offset DST1         ;xmitted dest address
  122.     mov    cx,12            ;12 bytes
  123.     rep    movsb
  124.     MOV    AL,MSG2
  125.     MOV    MSG1,AL
  126.     mov    si,offset ECB1
  127.     mov    bx,3
  128.     CALL    IPX            ; make sure we don't miss anything
  129.     mov    si,offset ECB2
  130.     mov    bx,4
  131.     CALL    IPX            ; make sure we don't miss anything
  132.     CLI                ; ESRs MUST RETURN WITH INTS OFF
  133.     RET                ; LEAVE
  134. RCVD    ENDP
  135.  
  136. IPX    PROC    NEAR
  137.     PUSH    CS
  138.     POP    DS
  139.     PUSH    CS
  140.     POP    ES
  141.     PUSH    BP
  142.     INT    7Ah
  143.     POP    BP
  144.     PUSH    CS
  145.     POP    ES
  146.     PUSH    CS
  147.     POP    DS
  148.     RET
  149. IPX    ENDP
  150.  
  151. ;************************************************************************
  152. ;* Main section of program                                              *
  153. ;************************************************************************
  154. MAIN:
  155.     MOV    SEG1F,CS
  156.     MOV    SEG2,CS
  157.     MOV    SEG2F,CS
  158.     CMP    BYTE PTR DS:[80h],0
  159.     JZ    MAIN10
  160.     JMP    MAIN50
  161. MAIN10:                ;*********** Setup MEMORY resident portion
  162.     MOV    BX,0            ; OPEN SOCKET
  163.     MOV    DX,SOCKET        ; RECEIVE SOCKET
  164.     MOV    SOCK1,DX
  165.     MOV    SOCK2,DX
  166.     MOV    AL,0FFh            ; PERMANENT
  167.     CALL    IPX
  168.     MOV    ADR2,OFFSET RCVD
  169.     MOV    SI,OFFSET ECB2
  170.     MOV    BX,4
  171.     CALL    IPX
  172.     MOV    DX,OFFSET MAIN
  173.     INT    27h
  174.  
  175. MAIN50:                ;*********** Set up Calling section
  176.     MOV    ADR2,OFFSET RCVD2
  177.     MOV    SEG3,CS
  178.     MOV    ADR3,OFFSET TIMLOOP
  179.     MOV    BX,0                ;open socket
  180.     MOV    DX,0                ;transmit socket
  181.     MOV    AL,0                ;temporary
  182.     CALL    IPX
  183.     MOV    SOCK1,DX
  184.     MOV    SOCK2,DX
  185.     mov    si,offset dst1
  186.     mov    di,offset imad1
  187.     mov    bx,2                ;get local target
  188.     CALL    IPX
  189.     MOV    SI,OFFSET ECB2
  190.     MOV    BX,4
  191.     CALL    IPX
  192.     MOV    SI,OFFSET ECB3
  193.     MOV    AX,10
  194.     MOV    BX,7
  195.     CALL    IPX
  196. MAIN60:    MOV    AH,1            ; Loop until a key is struck
  197.     INT    16h
  198.     JZ    MAIN60
  199.     MOV    AH,0
  200.     INT    16h
  201.     MOV    SI,OFFSET ECB3
  202.     MOV    BX,6
  203.     CALL    IPX
  204.     MOV    SI,OFFSET ECB2
  205.     MOV    BX,6
  206.     CALL    IPX
  207.     MOV    SI,OFFSET ECB1
  208.     MOV    BX,6
  209.     CALL    IPX
  210.     MOV    DX,SOCK1
  211.     MOV    BX,1
  212.     CALL    IPX
  213.     INT    20h
  214.  
  215. ;************************************************************************
  216. ;* Receive an echoed IPX packet and display the character               *
  217. ;************************************************************************
  218. RCVD2    proc    far            ;event service routine
  219.     MOV    AL,MSG2
  220.     MOV    AH,14
  221.     XOR    BX,BX
  222.     MOV    BL,70h
  223.     MOV    CX,1
  224.     INT    10h
  225.     MOV    SI,OFFSET ECB2
  226.     MOV    BX,4
  227.     CALL    IPX
  228.     CLI
  229.     RET
  230. RCVD2    ENDP
  231.  
  232. ;************************************************************************
  233. ;* Every 10 tics display another character and send the IPX packet      *
  234. ;************************************************************************
  235. TIMLOOP    proc    far            ;event service routine
  236.     INC    MSG1
  237.     MOV    AL,MSG1
  238.     MOV    AH,14
  239.     XOR    BX,BX
  240.     MOV    BL,7
  241.     MOV    CX,1
  242.     INT    10h
  243.     CMP    INUSE1,0
  244.     JZ    TM10
  245.     MOV    SI,OFFSET ECB1
  246.     MOV    BX,6
  247.     CALL    IPX
  248. TM10:    MOV    SI,OFFSET ECB1
  249.     MOV    BX,3
  250.     CALL    IPX
  251.     MOV    SI,OFFSET ECB3
  252.     MOV    AX,10
  253.     MOV    BX,7
  254.     CALL    IPX
  255.     CLI
  256.     RET
  257. TIMLOOP    ENDP
  258.  
  259. CSEG    ENDS
  260.     END    ENTRY
  261.